<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>20211019第一次的js学习</title>
</head>
<body>
    <h1>yyds</h1>
   <h2> <p id="123">贾宝玉倒拔垂杨柳</p></h2>
<script>function MyfirstFunction()
{
x=document.getElementById("123");
x.innerHTML="刘皇叔三打白骨精";
}
</script>
<button type="button" onclick="MyfirstFunction()">下联<button>  
    <script>function MyirstFunction()
        {
        x=document.getElementById("123");
        x.innerHTML="贾宝玉倒拔垂杨柳";
        }
        </script>
        <button type="button" onclick="MyirstFunction()">上联<button>  
<br>
<script>
 
document.write("<h1>《浪淘沙》</h1>")
document.write("<h3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;刘禹锡</h3>")
document.write("<h2>莫道谗言如浪深,</h2>")
document.write("<h2>莫言迁客似沙沉。</h2>")
document.write("<h2>千淘万漉虽辛苦,</h2>")
document.write("<h2>吹尽狂沙始到金。</h2>")
</Script>
</br>
<button type="button" onclick="alert('成啦!')">点我!</button>
</body>
</html>